package com.cmc.cloud.cmclink.doc.vo.voyagebookingtimevo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.util.*;

import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

/**
 * 航次截止时间 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VoyageBookingTimeBaseVO {

    @Schema(description = "船舶代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "｛VoyageBookingTimeBaseVO.vesselCode.NotBlank｝")
    @Length(max = 50, message = "｛VoyageBookingTimeBaseVO.vesselCode.Length｝")
    private String vesselCode;

    @Schema(description = "航次", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "｛VoyageBookingTimeBaseVO.voyage.NotBlank｝")
    @Length(max = 50, message = "｛VoyageBookingTimeBaseVO.voyage.Length｝")
    private String voyage;

    @Schema(description = "进出口类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotBlank(message = "｛VoyageBookingTimeBaseVO.exImType.NotBlank｝")
    @Length(max = 2, message = "｛VoyageBookingTimeBaseVO.exImType.Length｝")
    private String exImType;

    @Schema(description = "装货港", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "｛VoyageBookingTimeBaseVO.podCode.NotBlank｝")
    @Length(max = 5, message = "｛VoyageBookingTimeBaseVO.podCode.Length｝")
    private String podCode;

    @Schema(description = "ETD ETA时间")
    private String etdOrEta;

    @Schema(description = "航线编码")
    private String laneCode;

    @Schema(description = "时间信息")
    private List<TimeInfo> timeInfos;

    @Data
    @ToString
    public static class TimeInfo {
        @Schema(description = "时间类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
        @NotBlank(message = "｛VoyageBookingTimeBaseVO.TimeInfo.timeType.NotBlank｝")
        @Length(max = 5, message = "｛VoyageBookingTimeBaseVO.TimeInfo.timeType.Length｝")
        private String timeType;

        @Schema(description = "节点时间  yyyy-mm-dd hh:mm:ss", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotBlank(message = "｛VoyageBookingTimeBaseVO.TimeInfo.timeValue.NotBlank｝")
        @Length(max = 20, message = "｛VoyageBookingTimeBaseVO.TimeInfo.timeValue.Length｝")
        private String timeValue;

        @Schema(description = "对应表记录中的id")
        private Long id;
    }

}
